// Table 5. Placebo tests
use "eseewithinfirm.dta", clear

local filename "tableA3"
xi: xtreg lnval i.year*longinv8 i.category, fe cluster(firmid)
foreach year in 2008 2009 2010 {
test _IyeaXlon_2007=_IyeaXlon_`year'
local f`year'=r(F)
local p`year'=r(p)
}
outreg2  using "`filename'", word replace label dec(3)  nocons keep(_IyeaXlon_2*)  ///
	addstat(F-stat 2007=2008, `f2008', p-val 2008, `p2008',F-stat 2007=2009, `f2009', p-val 2009, `p2009',F-stat 2007=2010, `f2010', p-val 2010, `p2010')
foreach reg in longinv10 longinv11 longinv12 longinv13 {
xi: xtreg lnval i.year*`reg' i.category, fe cluster(firmid)
foreach year in 2008 2009 2010 {
test _IyeaXlon_2007=_IyeaXlon_`year'
local f`year'=r(F)
local p`year'=r(p)
}
outreg2  using "`filename'", word  label dec(3)  nocons keep(_IyeaXlon_2*) ///
	addstat(F-stat 2007=2008, `f2008', p-val 2008, `p2008',F-stat 2007=2009, `f2009', p-val 2009, `p2009',F-stat 2007=2010, `f2010', p-val 2010, `p2010')
}
